package Content;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * TCSS 360 - Winter 2014
 * TESK Software
 */

/**
 * Represents a paper object.
 * Thang - initialized reviewList in constructor
 * 
 * @author Emily Linniman
 * @version March 3, 2014
 */
public class Paper {

	/** An id that identifies the paper. */
	private int id;
	
	/** The author of the paper. */
	private String author;
	
	/** The title of the paper. */
	private String title;
	
	/** A file object that represents the paper. */
	private File paper;
	
	/** A list of file objects that represent
	  		the reviews of the paper. */
	private List<File> reviewList;
	
	/** A value that determines whether or not the paper
	  		is recommended for the conference.*/
	private boolean recommend;
	
	/** 
	 * Constructs a paper object.
	 * 
	 * @param the_author the given author of the paper
	 * @param the_title the given title of the paper
	 */
	public Paper(String the_author, String the_title) {
		author = the_author;
		title = the_title;
		recommend = false;
		List<File> reviewList = new ArrayList<File>();
	}
	
	/**
	 * Accesses the author of the paper.
	 * @return the author of the paper
	 */
	public String getAuthor() {
		return author;
	}
	
	/**
	 * Accesses the title of the paper.
	 * @return the title of the paper
	 */
	public String getTitle() {
		return title;
	}
	
	/**
	 * Sets the ID of the paper.
	 * @param the_id the given ID of the paper
	 */
	public void setID(int the_id) {
		id = the_id;
	}
	
	/**
	 * Accesses the ID of the paper.
	 * @return the ID of the paper
	 */
	public int getID() {
		return id;
	}
	
	/**
	 * Accesses the file paper of the paper object.
	 * @return the paper file
	 */
	public File getPaper() {
		return paper;
	}
	
	/**
	 * Sets the boolean value of the paper recommendation.
	 * @param the_recommend the given boolean recommendation
	 */
	public void setRecommend(boolean the_recommend) {
		recommend = the_recommend;
	}
	
	/**
	 * Accesses the boolean recommendation of the paper.
	 * @return the boolean value of whether the paper is 
	 * 				recommended or not
	 */
	public boolean getRecommend() {
		return recommend;
	}
	
	/**
	 * Adds a review file to the paper's review list.
	 * @param the_review gives the review to be added to 
	 * 			the review list
	 */
	public void addReview(File the_review) {
		reviewList.add(the_review);
	}
	
	/**
	 * Accesses the list of review files for the paper.
	 * @return the list or review files for the paper.
	 */
	public List<File> getReviews() {
		return reviewList;
	}

	/**
	 * Equals Method
	 */
	@Override
	public boolean equals(Object otherPaper) {
		if(otherPaper instanceof Paper) {
			return ((Paper)otherPaper).getID()==this.getID();
		}
		return false;
	}
	
	
}
